from fastapi import FastAPI
from internal.auth import auth
from internal.sqllite.database import engine
from internal.model import Base
from internal.getdata import jwzx
import uvicorn


Base.metadata.create_all(bind=engine)
app = FastAPI(
    title="jwzx速览",
    description="可快速查看jwzx公告",
    version="0.0.1",
    docs_url="/",
    redoc_url=None,
)

app.include_router(auth, prefix="/api/auth", tags=["auth"]  )
app.include_router(jwzx, prefix="/api/jwzx", tags=["jwzx"])


@app.get("/api/v1/status")
async def status():
    return {"status": "ok", "version": "0.0.1"}


if __name__ == "__main__":
    uvicorn.run(app = app, host="127.0.0.1", port=8000)